<?php

namespace App\Models;


use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;

class JobCate extends Model
{
	
    protected $table = 'jobcate';
    public $timestamps = false;

    //获取所有职位分类
    public static function getAllCate(){
        return self::query()->get(['id', DB::raw('name as text')]) ?? [];
    }
    //获取职位通过id
    public  function getJobCateById($id){
        return self::query()->where('id',$id)->value('name');
    }
}
